package combination;

import sun.awt.HeadlessToolkit;

class Animal {
    protected String name;
    protected int age;
    public void eat(){
        System.out.println(name + "正在吃饭");
    }
    public void sleep(String name){
        System.out.println(name+ "正在睡觉");
    }
}

class Cat extends Animal {
    @Override
    public void eat() {
        System.out.println("小猫正在吃饭");
    }

}

public class Dog extends Animal{
    @Override
    public void eat() {
        System.out.println("小狗正在吃饭");
    }
    public void sleep(){
        System.out.println("小狗正在睡觉");
    }

    public static void main(String[] args) {
        Animal animal = new Dog();
//        Animal animal1 = new Animal();
//        Animal animal2 = new Cat();
        animal.eat();
        animal.sleep("小黄");
        Dog dog = new Dog();
        dog.sleep();
//        animal1.eat();
//        animal2.eat();
    }
}
